package com.k2data.k2app.rest;

import com.k2data.k2app.domain.deviceRest.Event;
import com.k2data.k2app.domain.deviceRest.MonitorLimitValue;
import com.k2data.k2app.rest.domain.RectList;
import com.k2data.k2app.rest.domain.RectObject;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDate;

/**
 * Created by clb on 17-6-15.
 */
@Component
public class DeviceClientFallbackV2 implements DeviceClientV2 {

	@Override
	public RectList getAllDevices (@RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize") Integer pageSize,@RequestParam("deviceNo") String deviceNo) {
		RectList rectList = new RectList();
		return rectList.initDeviceRectList();
	}

	@Override
	public RectList getDeviceByCustomer(@PathVariable("id") Long id) {
		RectList rectList = new RectList();
		return rectList.initDeviceRectList();
	}

	@Override
	public RectObject getDeviceById (@PathVariable("id") Long id) {
		RectObject rectObject = new RectObject();
		return rectObject.initDeviceRectMap();
	}

	@Override
	public RectObject updateDevice (@PathVariable("id") Long id, Object device) {
		RectObject rectObject = new RectObject();
		return rectObject.initDeviceRectMap();
	}

	@Override
	public RectList getTemplateDeviceById (@RequestParam("id") Long id) {
		RectList rectObject = new RectList();
		return rectObject.initDeviceRectList();
	}

	@Override
	public RectList getTemplatePointById (@PathVariable("id") Long id) {
		RectList rectObject = new RectList();
		return rectObject.initDeviceRectList();
	}

	@Override
	public RectObject getDevicePointById(@PathVariable("id") Long id) {
		RectObject rectObject = new RectObject();
		return rectObject.initDeviceRectMap();
	}

	@Override
	public RectList getDevicePoint(@RequestParam("root_id") Long root_id, @RequestParam("monitorPointId") Long monitorPointId,
								   @RequestParam("channelId") Integer channelId,
								   @RequestParam("isGroup") boolean isGroup) {
		RectList rectObject = new RectList();
		return rectObject.initDeviceRectList();
	}

	@Override
	public RectList getDevicePointGroup(@RequestParam("root_id") Long root_id,
										  @RequestParam("monitorPointId") Long monitorPointId,
										  @RequestParam("channelId") Integer channelId,
										  @RequestParam("isGroup") boolean isGroup,
										  @RequestParam("groupType") Integer groupType) {
		RectList rectObject = new RectList();
		return rectObject.initDeviceRectList();
	}

	@Override
	public RectList getTemplateVariablesById (@PathVariable("id") Long id) {
		RectList rectObject = new RectList();
		return rectObject.initDeviceRectList();
	}

	@Override
	public RectList getDeviceVariablesById(@PathVariable("id") Long id) {
		RectList rectObject = new RectList();
		return rectObject.initDeviceRectList();
	}

	@Override
	public RectList getCustomers(@RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, @RequestParam(value = "location", required = false) String location, @RequestParam(value = "industry", required = false) String industry, @RequestParam(value = "customerType", required = false) String customerType, @RequestParam(value = "dataSource", required = false) String dataSource, @RequestParam(value = "owner", required = false) String owner, @RequestParam(value = "status", required = false) String status, @RequestParam(value = "userId", required = false) Long userId, @RequestParam(value = "customerNo", required = false) String customerNo, @RequestParam(value = "pageNum", required = false) Integer pageNum, @RequestParam(value = "pageSize", required = false) Integer pageSize, @RequestParam(value = "name", required = false) String name) {
		RectList rectObject = new RectList();
		return rectObject.initDeviceRectList();
	}

	@Override
	public RectObject getCustomerById (@RequestParam(value = "id") Long id) {
		RectObject rectObject = new RectObject();
		return rectObject.initDeviceRectMap();
	}

	@Override
	public RectObject addEvent (@RequestBody Event event) {
		RectObject rectObject = new RectObject();
		return rectObject.initDeviceRectMap();
	}

	@Override
	public void changeStatus(String deviceNo, String status) {
	}

	@Override
	public RectList getDeviceLimitValues(@RequestParam(value = "deviceId", required = false) Long deviceId, @RequestParam(value = "monitorPointId", required = false) Long monitorPointId, @RequestParam(value = "variableId", required = false) Long variableId, @RequestParam(value = "deviceNo", required = false) String deviceNo, @RequestParam(value = "channelId", required = false) Integer channelId, @RequestParam(value = "level", required = false) Integer level, @RequestParam(value = "isTemplateVariable", required = false) boolean isTemplateVariable) {
		RectList rectObject = new RectList();
		return rectObject.initDeviceRectList();
	}

	@Override
	public RectObject updateMonitorLimit(@PathVariable("id") Long id, @RequestBody MonitorLimitValue limitValue, @RequestParam(value = "limit2kmx", required = false) boolean limit2kmx) {
		RectObject rectObject = new RectObject();
		return rectObject.initDeviceRectMap();
	}

	@Override
	public RectObject getContactById(@PathVariable("id") Long id) {
		RectObject rectObject = new RectObject();
		return rectObject.initDeviceRectMap();
	}


}
